define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'jizhan.return_point_order/index?type='+type+'&uid='+uid,
        add_url: 'jizhan.return_point_order/add',
        edit_url: 'jizhan.return_point_order/edit',
        delete_url: 'jizhan.return_point_order/delete',
        export_url: 'jizhan.return_point_order/export',
        modify_url: 'jizhan.return_point_order/modify',
    };
    var Controller = {

        index: function () {
            ea.table.render({
                /*id,订单id,订单号,商品id,商品名称,购买用户信息,订单实际支付金额,返点金额,备注说明,创建时间*/
                init: init,
                cols: [[
                    {type: "checkbox"},
                    {field: 'id', title: 'ID', search: 'no'},
                    {field: 'oid',title: '订单id' },
                    {field: 'orderId',title: '订单编号' },
                    {field: 'storeInfo',title: '订单所在门店' , search: 'no'},
                    {field: 'product_id', title: '商品ID', search: 'no'},
                    {field: 'product_name', title: '商品名称', search: 'no'},
                    {field: 'userInfo', title: '购买用户信息', search: 'no'},
                    {field: 'pay_price', title: '订单实际支付金额', search: 'no'},
                    {field: 'grade3UserInfo', title: '社群节点用户信息', search: 'no'},
                    {field: 'grade3_return_price', title: '订单社群节点返点金额', search: 'no'},
                    {field: 'grade4UserInfo', title: '联盟节点用户信息', search: 'no'},
                    {field: 'grade4_return_price', title: '联盟节点返点金额', search: 'no'},
                    {field: 'remark', title: '备注说明', search: 'no'},
                    {field: 'create_time', title: '创建时间', search: 'range'},
                    {field: 'grade3Phone', title: '社群节点用户号码', hide: true},
                    {field: 'grade4Phone', title: '联盟节点用户号码', hide: true},
                    // {
                    //     title: '操作', templet: ea.table.tool,
                    //     operat: ['edit','delete']
                    // }
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});